package com.cellulam.framework.datasource.service;

import com.cellulam.framework.core.model.Id;
import com.cellulam.framework.core.model.UpdateUser;
import org.springframework.beans.factory.annotation.Autowired;

import java.io.Serializable;

public abstract class BaseUpdateUserDtoService<PK, BEAN extends Serializable & Id<PK>, REQ extends UpdateUser<PK>, RESP extends Serializable>
        extends BaseIdDtoService<PK, BEAN, REQ, RESP> {

    @Autowired
    protected UpdateUserRequestUtils updateUserRequestUtils;

    @Override
    public PK save(REQ request) {
        this.updateUserRequestUtils.fillCreateUser(request);
        return super.save(request);
    }

    @Override
    public int update(REQ request) {
        this.updateUserRequestUtils.fillUpdateUser(request);
        return super.update(request);
    }


}

